<!DOCTYPE html>
<html lang="UTF-8" xmlns:th="http://www.thymeleaf.org">
<head th:replace="include-common :: common-head(~{::title})">
    <title>target</title>
</head>
<script type="text/javascript">
    $(function (){
        $("#toRightBtn").click(function () {
            $("select:eq(0)>option:selected").appendTo("select:eq(1)")
        });

        $("#toLeftBtn").click(function () {
            $("select:eq(1)>option:selected").appendTo("select:eq(0)")
        });

        $("#submitBtn").click(function () {
            $("select:eq(1)>option").prop("selected","selected");
        })
    })
</script>
<body>

<div th:replace="include-common :: common-nav"></div>

<div class="container-fluid">
    <div class="row">
        <div th:replace="include-common :: common-sidebar"></div>
        <div class="col-sm-9 col-sm-offset-3 col-md-10 col-md-offset-2 main">
            <ol class="breadcrumb">
                <li><a href="#">首页</a></li>
                <li><a href="#">数据列表</a></li>
                <li class="active">分配角色</li>
            </ol>
            <div class="panel panel-default">
                <div class="panel-body">
                    <form th:action="@{/assign/do/role/assign.html}" role="form" class="form-inline">
                        <input type="hidden" name="adminId" th:value="${param.adminId}"/>
                        <input type="hidden" name="pageNum" th:value="${param.pageNum}"/>
                        <input type="hidden" name="keyword" th:value="${param.keyword}"/>
                        <div class="form-group">
                            <label for="exampleInputPassword1">未分配角色列表</label><br>
                            <select class="form-control" multiple="multiple" size="10" style="width:100px;overflow-y:auto;">
                                <option th:each="role:${unAssignedRoleList}" th:value="${role.id}" th:text="${role.name}"></option>
                            </select>
                        </div>
                        <div class="form-group">
                            <ul>
                                <li id="toRightBtn" class="btn btn-default glyphicon glyphicon-chevron-right"></li>
                                <br>
                                <li id="toLeftBtn" class="btn btn-default glyphicon glyphicon-chevron-left" style="margin-top:20px;"></li>
                            </ul>
                        </div>
                        <div class="form-group" style="margin-left:40px;">
                            <label for="exampleInputPassword1">已分配角色列表</label><br>
                            <select name="roleIdList" class="form-control" multiple="multiple" size="10" style="width:100px;overflow-y:auto;">
                                <option th:each="role:${assignedRoleList}" th:value="${role.id}" th:text="${role.name}"></option>
                            </select>
                        </div>
                        <input id="submitBtn" type="submit" style="width: 100px;margin-top: 10px;margin-left: 230px" class="btn btn-lg btn-success btn-block" value="保存">
                    </form>
                </div>
            </div>
        </div>
    </div>
</div>


</body>
</html>